package de.wesemann.jdedun.implementation.mediahandbook;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.wesemann.jdedun.entities.mediahandbook.companies.MediahandbookCompaniesContainer;
import de.wesemann.jdedun.entities.mediahandbook.companies.MediahandbookCompany;
import de.wesemann.jdedun.implementation.AbstractResource;
import de.wesemann.jdedun.implementation.ImplementationInterface;

public class MediahandbookCompaniesImpl implements ImplementationInterface {

    private String urlStub = "mediahandbook/companies";
    private Logger logger = LoggerFactory
	    .getLogger(MediahandbookCompaniesImpl.class);
    private AbstractResource resource = new AbstractResource(urlStub);

    public int count() {

	return resource.count();
    }

    /**
     * 
     * @return
     */
    public List<MediahandbookCompany> getAll() {
	return resource.getAll(MediahandbookCompaniesContainer.class).getData();
    }

    /**
     * 
     * @param n
     * @return
     */
    public List<MediahandbookCompany> getFirstN(int n) {
	return resource.get(n, 0, MediahandbookCompaniesContainer.class)
		.getData();
    }

    public List<MediahandbookCompany> getNextN(int n, int offest) {
	return resource.get(n, offest, MediahandbookCompaniesContainer.class)
		.getData();
    }

    /**
     * 
     * @param searchTupel
     * @return
     */
    public List<MediahandbookCompany> search(Map<String, String> searchTupel) {
	return resource.search(searchTupel,
		MediahandbookCompaniesContainer.class).getData();
    }

    public String getURLStub() {
	return urlStub;
    }

    public void setURLStub(String urlStub) {
	this.urlStub = urlStub;
    }
}
